﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    Tag="Layout - Expander and Grid">
    <UserControl.Resources>
        <Style x:Key="StackPanelRoot" TargetType="StackPanel">
            <Setter Property="Height" Value="300" />
            <Setter Property="Width" Value="512" />
            <Setter Property="Background" Value="SeaShell" />
        </Style>

        <Style x:Key="StackPanelFooter" TargetType="StackPanel">
            <Setter Property="Height" Value="15" />
            <Setter Property="Background" Value="Gray" />
        </Style>

        <Style x:Key="GridRoot" TargetType="Grid">
            <Setter Property="Height" Value="285" />
        </Style>
    </UserControl.Resources>
    <StackPanel Style="{StaticResource StackPanelRoot}">
        <Grid Style="{StaticResource GridRoot}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <toolkit:Expander Grid.Row="0" Background="Yellow" IsExpanded="False">
                <StackPanel>
                    <Rectangle Fill="Red" Height="60" Width="60"/>
                    <Rectangle Fill="Green" Height="60" Width="60"/>
                </StackPanel>
            </toolkit:Expander>
            <StackPanel Grid.Row="1" Background="Blue" Orientation="Horizontal">
                <Rectangle Fill="Red" Height="160" Width="160"/>
                <Rectangle Fill="Green" Height="160" Width="160"/>
            </StackPanel>
        </Grid>
        <StackPanel Style="{StaticResource StackPanelFooter}" />
    </StackPanel>
</UserControl>
